#ifndef HTTPREQUESTPARSER_HPP
#define HTTPREQUESTPARSER_HPP

#include <string>
#include "HttpRequest.hpp"

/**
 * Stream parser
 * Parse and validate http request from bytes
 */
class HttpRequestParser {
private:
	enum {
		STATE_PARISING_HTTP_METHOD, STATE_PARISING_HTTP_HEADERS, STATE_PARISING_FINISHED
	};
	HttpRequest request;

	int state;

public:
	HttpRequestParser();

	bool putLine(const std::string & line);
	HttpRequest getHttpRequest();
};

#endif /* HTTPREQUESTPARSER_HPP */
